package com.yuhs.zixing.study.design.pattern.dp002.create.c002.factory.f003;

/**
 * @description:
 * @author: yuhs
 * @date: 2022/4/21 4:30 AM
 */
public class ConcreteCreator extends Creator {
    @Override
    public <T extends Product> T createProduct(Class<T> c) {
        Product product = null;
        try {
            product = (Product) Class.forName(c.getName()).newInstance();
        } catch (Exception e) {
            //异常处理
        }
        return (T) product;
    }
}
